<layout name ="common" />
<div class="templatemo-content-widget no-padding">
	<div class="panel panel-default table-responsive">
		<table class="table table-striped table-bordered templatemo-user-table">
			<thead>
				<div class="panel-heading border-radius-10">
					<h2 style="font-size: 20px; display: inline-block; padding-left: 100px;">文章列表</h2>
					<a style="font-size: 20px; display: inline-block; margin-left: 100px;" href="__ROOT__/article/addArticle.html" class="templatemo-is-btn">发布新文章</a>
				</div>
				<tr>
					<th style="text-align: center;"><a href="__ROOT__/article/articleManage/order/id" class="white-text templatemo-sort-by">ID <span class="caret"></span></a></th>
					<th style="text-align: center;"><a href="__ROOT__/article/articleManage/order/cateid" class="white-text templatemo-sort-by">分类 <span class="caret"></span></a></th>
					<th style="text-align: center;"><a href="__ROOT__/article/articleManage/order/title" class="white-text templatemo-sort-by">标题 <span class="caret"></span></a></th>
					<th style="text-align: center;"><a href="__ROOT__/article/articleManage/order/author" class="white-text templatemo-sort-by">作者 <span class="caret"></span></a></th>
					<th style="text-align: center;"><a href="__ROOT__/article/articleManage/order/artid" class="white-text templatemo-sort-by">发布者 <span class="caret"></span></a></th>
					<th style="text-align: center;"><a href="__ROOT__/article/articleManage/order/creattime desc" class="white-text templatemo-sort-by">发布时间 <span class="caret"></span></a></th>
					<th style="text-align: center;"><a href="__ROOT__/article/articleManage/order/updatetime desc" class="white-text templatemo-sort-by">修改时间 <span class="caret"></span></a></th>
					<th style="text-align: center;"><a href="__ROOT__/article/articleManage/order/hits desc" class="white-text templatemo-sort-by">点击量 <span class="caret"></span></a></th>
					<th style="text-align: center;">操作</th>
				</tr>
			</thead>
			<tbody style="text-align: center;">
			<foreach name='res' item='k'>
				<tr>
					<td>{$k.id}</td>
					<td>{$k.cate}</td>
					<td>{$k.title}</td>
					<td>{$k.author}</td>
					<td>{$k.username}</td>
					<td>{$k.creattime|date='Y-m-d H:i:s',###}</td>
					<td>{$k.updatetime|date='Y-m-d H:i:s',###}</td>
					<td>{$k.hits}</td>
					<if condition='$admininfo.is_admin eq 1'>
					<td>
						<a href="__ROOT__/article/showArt/id/{$k.id}" class="templatemo-is-btn">详情</a>
						<if condition='$k.is_home eq 1'>
							<a href="__ROOT__/article/toHome/id/{$k.id}/is_home/{$k.is_home}" class="templatemo-no-btn">已首页</a>
						<else/>
							<a href="__ROOT__/article/toHome/id/{$k.id}/is_home/{$k.is_home}" class="templatemo-is-btn">未首页</a>
						</if>
						<if condition='$k.is_top eq 1'>
							<a href="__ROOT__/article/toTop/id/{$k.id}/is_top/{$k.is_top}" class="templatemo-no-btn">已顶置</a>
						<else/>
							<a href="__ROOT__/article/toTop/id/{$k.id}/is_top/{$k.is_top}" class="templatemo-is-btn">未顶置</a>
						</if>
						<a href="__ROOT__/article/addArticle/id/{$k.id}" class="templatemo-is-btn">编辑</a>
						<a href="javascript:void(0)" onclick="delAdmin({$k.id})" class="templatemo-is-btn">删除</a>
					</td>
					<else />
					<td>当前用户无法操作</td>
					</if>
				</tr>
			</foreach>
			</tbody>
		</table>
		<div class="pagination-wrap">
			{$page}
		</div>
	</div>
</div>
<script type="text/javascript">
	$(document).ready(function(){
		$("#leftMenu a[class='active']").removeClass("active");
		$('#leftMenu a:eq(1)').addClass("active");
	});
	function delAdmin(id){
		if(window.confirm("您确定要删除吗？")){
			window.location="__ROOT__/article/delArt/id/"+id;
		}
	}
</script>